-- GENERATED SPELL FOR [Dark Rune Elementalist] --


function spell0_27962(pUnit, Event) --@Arcane Haste,n/a--
pUnit:FullCastSpellOnTarget(32693,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_27962', 30279, 1)
end

function spell1_27962(pUnit, Event) --@Lightning Bolt,n/a--
pUnit:FullCastSpellOnTarget(53314,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_27962', 2000, 1)
end

function spell2_27962(pUnit, Event) --@Lightning Bolt,n/a--
pUnit:FullCastSpellOnTarget(59024,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_27962', 2000, 1)
end

function spell3_27962(pUnit, Event) --@Lightning Shield,n/a--
pUnit:FullCastSpellOnTarget(51776,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_27962', 0, 1)
end

function spell4_27962(pUnit, Event) --@Lightning Shield,n/a--
pUnit:FullCastSpellOnTarget(59025,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_27962', 0, 1)
end

function spell5_27962(pUnit, Event) --@Summon Air Elemental,Self--
pUnit:FullCastSpellOnTarget(51475,pUnit)
pUnit:RegisterEvent('Sorts_27962', 21500, 1)
end

function Sorts_27962(pUnit, Event)
local choix_sorts_27962 = math.random(0, 5)
if choix_sorts_27962 == 0 then
pUnit:RegisterEvent('spell0_27962', 1, 1)
end
if choix_sorts_27962 == 1 then
pUnit:RegisterEvent('spell1_27962', 1, 1)
end
if choix_sorts_27962 == 2 then
pUnit:RegisterEvent('spell2_27962', 1, 1)
end
if choix_sorts_27962 == 3 then
pUnit:RegisterEvent('spell3_27962', 1, 1)
end
if choix_sorts_27962 == 4 then
pUnit:RegisterEvent('spell4_27962', 1, 1)
end
if choix_sorts_27962 == 5 then
pUnit:RegisterEvent('spell5_27962', 1, 1)
end
end

function mob27962_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_27962', math.random(1500, 3000), 1)
end

function mob27962_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob27962_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob27962_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(27962, 1, 'mob27962_Action')
RegisterUnitEvent(27962, 2, 'mob27962_Leave')
RegisterUnitEvent(27962, 3, 'mob27962_Kill')
RegisterUnitEvent(27962, 4, 'mob27962_Die')
